import request from '@/utils/request'

// 知识库管理
export function knowledgeList(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/pageList',
    method: 'get',
    params: query
  })
}

export function knowledgeDel(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/deleteById',
    method: 'get',
    params: query
  })
}

export function knowledgeUpdateStatus(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/updateStatus',
    method: 'get',
    params: query
  })
}

export function knowledgeDetail(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/getById',
    method: 'get',
    params: query
  })
}

export function knowledgeUpdate(data) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/updateById',
    method: 'post',
    data
  })
}

export function knowledgeAdd(data) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/add',
    method: 'post',
    data
  })
}

export function userList(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/account/pageList',
    method: 'get',
    params: query
  })
}

export function knowledgeCommentAdd(data) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledgeComment/add',
    method: 'post',
    data
  })
}

export function knowledgeClassifyAllList(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/category/selectByConditions',
    method: 'get',
    params: query
  })
}

// 知识库分类管理
export function knowledgeClassifyList(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/category/select/page',
    method: 'get',
    params: query
  })
}

export function knowledgeClassifyAdd(data) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/category/add',
    method: 'post',
    data
  })
}

export function knowledgeClassifyDel(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/category/deleteById',
    method: 'get',
    params: query
  })
}

export function knowledgeClassifyDetail(query) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/category/getById',
    method: 'get',
    params: query
  })
}

export function knowledgeClassifyUpdate(data) {
  return request({
    url: '/jbl-knowledge/api/admin/v1/knowledge/category/updateById',
    method: 'post',
    data
  })
}
